<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>学生黑名单-自习预约管理系统</title>
    <!-- Favicon icon -->
    <link rel="icon" type="image/png" href="assets/images/favicon-32x32.png">
    <!-- Base Styling  -->
    <link rel="stylesheet" th:href="@{/assets/main/css/fonts.css}">
    <link rel="stylesheet" th:href="@{/assets/main/css/style.css}">
</head>

<body>
<div id="main-wrapper" class="show">

    <!--        &lt;!&ndash; start logo components &ndash;&gt;-->
    <!--        <div th:replace="~{commons/common::banner_logo}"></div>-->
    <!--        &lt;!&ndash; End logo components &ndash;&gt;-->


    <!-- start section sidebar -->
    <div th:replace="~{commons/common::sidebar(active='blacklist')}"></div>
    <!-- End section sidebar -->


    <!-- start section header -->
    <div th:replace="~{commons/common::header}"></div>
    <!-- End section header -->


    <!-- start section content -->
    <div class="content-body">
        <div class="warper container-fluid">
            <div class="new_appointment main_container">
                <div class="row page-titles mx-0">
                    <div class="col-sm-6 p-md-0">
                        <div class="welcome-text">
                            <h4 class="text-primary">学生黑名单管理</h4>
                        </div>
                    </div>
                    <div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item"><a th:href="@{/index}">首页</a></li>
                            <li class="breadcrumb-item active"><a th:href="@{/blacklist}">学生黑名单管理</a>
                            </li>
                        </ol>
                    </div>
                </div>
                <div class="row">
                    <div class="col-lg-12">
                        <div class="card shadow">
                            <div class="card-header">
                                <form class="row m-rl w-100" th:action="@{/blacklist}">
                                    <div class="col-lg-3 col-sm-12">
                                        <div class="form-group">
                                            <input id="myInputTextField" class="form-control" type="text" placeholder="根据学号或姓名搜索" name="searchByIdOrName">
                                        </div>
                                    </div>
                                    <div class="col-lg-3 col-sm-12">
                                        <div class="form-group">
                                            <select class="form-control table-filter-select form-select" name="selectedYear">
                                                <option value="" style="display: none">年级</option>
                                                <option>1</option>
                                                <option>2</option>
                                                <option>3</option>
                                                <option>4</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-lg-3 col-sm-12">
                                        <div class="form-group">
                                            <select class="form-control table-filter-select form-select" name="selectedMajor">
                                                <option value="" style="display: none">专业</option>
                                                <option>软件工程</option>
                                                <option>法学</option>
                                                <option>生物</option>
                                                <option>化学</option>
                                                <option>环境</option>
                                                <option>材料</option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="col-lg-3 col-sm-12">
                                        <div class="form-group">
                                            <button type="submit" class="btn btn-primary w-100 h-56" data-bs-toggle="modal" data-bs-target="#newAppointment">搜索</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <div class="card shadow">
                            <div class="card-body">
                                <div class="table-responsive">
                                    <table id="example3" class="display nowrap">
                                        <thead>
                                        <tr>
                                            <th>学号</th>
                                            <th>姓名</th>
                                            <th>班级</th>
                                            <th>专业</th>
                                            <th>年级</th>
                                            <th>开始时间</th>
                                            <th>结束时间</th>
                                            <th>操作员</th>
                                            <th></th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                            <tr th:each="blackedStudent:${allBlackedStudent}">
                                                <td th:text="${blackedStudent.getS_id()}"></td>
                                                <td th:text="${blackedStudent.getS_name()}"></td>
                                                <td th:text="${blackedStudent.getS_class()}"></td>
                                                <td th:text="${blackedStudent.getS_major()}"></td>
                                                <td th:text="${blackedStudent.getS_year()}"></td>
                                                <td th:text="${blackedStudent.getBlackList().getDate_begin()}"></td>
                                                <td th:text="${blackedStudent.getBlackList().getDate_end()}"></td>
                                                <td th:text="${blackedStudent.getBlackList().getBlacker_id()}"></td>
                                                <td>
                                                    <a type="button" data-bs-toggle='modal' data-bs-target='#modal-delete'>
                                                        <span class='fas fa-trash-alt'></span>
                                                    </a>

                                                    <div class="modal fade" id='modal-delete' tabindex="-1" role="dialog" aria-labelledby="modal-title-edit-modal">
                                                        <div class="modal-dialog modal-dialog-centered" role="document" >
                                                            <div class="modal-content">
                                                                <div class="modal-header">
                                                                    <h5 class="modal-title">
                                                                        提示信息
                                                                    </h5>
                                                                    <button type="button" class="close"
                                                                            data-bs-dismiss="modal" aria-label="Close"><span
                                                                            aria-hidden="true">&times;</span></button>
                                                                </div>
                                                                <div class="modal-body top-info">
                                                                    <p style="font-size: 22px;font-weight: bold">是否确认将该学生移出黑名单</p>
                                                                </div>
                                                                <div class="modal-footer">
                                                                    <a type="button" class="btn badge-primary" th:href="@{/blacklist_delete(s_id = ${blackedStudent.getS_id()})}">
                                                                        确认删除
                                                                    </a>
                                                                    <button type="button" class="btn btn-danger" data-bs-dismiss="modal">
                                                                        关闭
                                                                    </button>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- End section content -->

</div>

<!-- modal-->

<!-- modal-->

<!-- JQuery v3.5.1 -->
<script th:src="@{/assets/plugins/jquery/jquery.min.js}"></script>

<!-- popper js -->
<script th:src="@{assets/plugins/popper/popper.min.js}"></script>

<!-- Bootstrap -->
<script th:src="@{assets/plugins/bootstrap/js/bootstrap.min.js}"></script>

<!-- Moment -->
<script th:src="@{assets/plugins/moment/moment.min.js}"></script>

<!-- Date Range Picker -->
<script th:src="@{assets/plugins/daterangepicker/daterangepicker.min.js}"></script>

<!-- Datatable -->
<script th:src="@{assets/plugins/datatables/jquery.dataTables.min.js}"></script>
<script th:src="@{/assets/js/init-tdatatable.js}"></script>

<!-- Main Custom JQuery -->
<script th:src="@{assets/js/toggleFullScreen.js}"></script>
<script th:src="@{assets/js/main.js}"></script>

</body>

</html>